/**
 * 内置的默认配置
 * http://fis.baidu.com/fis3/docs/api/config-props.html
 *
var DEFAULT_SETTINGS = {
  project: {
    charset: 'utf8',
    md5Length: 7,
    md5Connector: '_',
    files: ['**'],
    ignore: ['node_modules/**', 'output/**', '.git/**', 'fis-conf.js']
  },

  component: {
    skipRoadmapCheck: true,
    protocol: 'github',
    author: 'fis-components'
  },

  modules: {
    hook: 'components',
    packager: 'map'
  },

  options: {}
};
*/

/**
 * fis3 中内嵌了很多常用的插件。
 * http://fis.baidu.com/fis3/docs/api/config-system-plugin.html
 *
  * fis-optimizer-clean-css
  * fis-optimizer-png-compressor
  * fis-optimizer-uglify-js
  * fis-spriter-csssprites
  * fis3-deploy-local-deliver
  * fis3-deploy-http-push
  * fis3-hook-components
  * fis3-packager-map
 */

// 排除文件 会覆盖默认
fis.set('project.ignore', fis.get('project.ignore').concat(['*.bak', 'PSD/**', 'dist/**','lib/**','README.md']));

fis.match('::image',{
  useHash:true
});

// 打包 压缩、优化
fis.media('optimize')
  // 启用打包插件，必须匹配 ::package
  .match('::package', {
    packager: fis.plugin('map'),
    spriter: fis.plugin('csssprites')
  })
  .match('*.js', {
    optimizer: fis.plugin('uglify-js', {
      mangle: {
        expect: ['require', 'define', 'some string'] //不想被压的
      }
    })
  })
  .match('*.css', {
    // htmlUseSprite: true,
    useSprite: true,
    optimizer: fis.plugin('clean-css', {
      'keepBreaks': true //保持一个规则一个换行
    })
  })
  .match('*.png', {
    optimizer: fis.plugin('png-compressor', {
      // pngcrush or pngquant
      // default is pngcrush
      type: 'pngquant'
    })
  })
  .match('*.{js,css,png,jpg}', {
    useHash: false,
    // 制定静态资源发布路径
    release:'/zt/ten/$0'
  });

fis.match('*.less',{
  parser:fis.plugin('less'),
  rExt:'.css'
});

